package com.allenyuan.renderobject;

import com.allenyuan.render.Renderer;

public class RenderPoint extends RenderObject {
	
	private int x;
	private int y;
	
	public RenderPoint(int x, int y) {
		super(RENDER_POINT);
		this.x = x;
		this.y = y;
	}

	public void move(int deltaX, int deltaY) {
		x += deltaX;
		y += deltaY;
	}
	
	public static int distance(RenderPoint p1, RenderPoint p2) {
		return (int) Math.sqrt(Math.pow(p1.getX() - p2.getX(), 2) + Math.pow(p1.getY() - p2.getY(), 2));
	}

	@Override
	public void draw(Renderer r) {
		// TODO Auto-generated method stub
		
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	@Override
	public String toString() {
		return "RenderPoint [x=" + x + ", y=" + y + "]";
	}

}
